-
Notifications
You must be signed in to change notification settings - Fork 29.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add webview restoration api proposal #46380
Conversation
@mjbvz What do you want me to review here? I think we discussed the API and I still think over-eager state synchronisation isn't the way to go but an explicit hook is way better. For the rest - I am not familiar with the code around webview editor et al anymore. |
@jrieken Please take a look at the new
|
Looks good. Yeah, I think the de/serialise-functions should be async (but maybe time-boxed). We already have the |
From microsoft#45994 Adds an experimental API that allows extensions to persist webviews and restore them even after vscode restarts. Uses this api to restore markdown previews. This is done by: - Adding a new `state` field on webviews. This is a json serializable blob of data - Adds a new `WebviewReviver` interface (name will probably change). This binds a specific viewType to a provider that can restore a webview's contents from its `state` - In VS Code core, persist webview editors. When we restart and need to show a webview, activate all extensions that may have reviviers for it using the `onView:viewType` activation event. Current implementation is sort of a mess. Will try to clean things up
From #45994
Adds an experimental API that allows extensions to persist webviews and restore them after vscode restarts. Uses this api to restore markdown previews.
This is done by:
Adding a new
state
field on webviews. This is a json serializable blob of dataAdds a new
WebviewReviver
interface (name will probably change). This binds a specific viewType to a provider that can restore a webview's contents from itsstate
In VS Code core, persist webview editors. When we restart and need to show a webview, activate all extensions that may have revivers using the
onView:viewType
activation event.Current implementation is sort of a mess. Will try to clean things up